package com.dcd.service.impl;

import com.dcd.mapper.Car_modelMapper;
import com.dcd.pojo.*;
import com.dcd.service.Car_modelService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Car_modelServiceImpl implements Car_modelService {

    @Autowired
    private Car_modelMapper cm;



    /**
     * 查询所有车型
     * @param car_series_id 车系id
     * @return
     */
    @Override
    public List<Car_model> selectModel(int car_series_id) {
        return cm.selectModel(car_series_id);
    }

    /**
     * 按车型id查询亮点配置
     * @param car_model_id 车型id
     * @return
     */
    @Override
    public List<Highlights_configuration> selectConfig(int car_model_id) {
        return cm.selectConfig(car_model_id);
    }

    /**
     * 按车型id查询详细配置
     * @param car_model_id 车型id
     * @return
     */
    @Override
    public Car_model selectBymodelId(int car_model_id) {
        return cm.selectBymodelId(car_model_id);
    }

    /**
     * 车型首页中的热门咨询
     * @param car_model_id 车型id
     * @return
     */
    @Override
    public List<Information> selectinformation(int car_model_id) {
        return cm.selectinformation(car_model_id);
    }

    /**
     * 根据车名查询车系
     * @param brand_id 车名称id
     * @return
     */
    @Override
    public List<Car_series> selectCar_series(int brand_id) {
        return cm.selectCar_series(brand_id);
    }

    /**
     * 查询车型页面图片内饰，外观，空间
     * @param car_model_images_type_id 大图类型id
     * @param brand_id 车系id
     * @return
     */
    @Override
    public Car_model_images selectCar_model_images(int car_model_images_type_id, int brand_id) {
        return cm.selectCar_model_images(car_model_images_type_id,brand_id);
    }

    /**
     * 获取亮点配置图片数量
     * @param car_model_id  车型id
     * @return
     */
    @Override
    public Highlights_configuration getConfigImgCount(int car_model_id) {
        return cm.getConfigImgCount(car_model_id);
    }

    /**
     * 根据id查询购车计算
     * @param car_model_id  车型id
     * @return
     */
    @Override
    public Car_model select_car_purchase_calculation(int car_model_id) {
        return cm.select_car_purchase_calculation(car_model_id);
    }
    /**
     * 根据品牌id或者车系id或者车型id查询选车当前位置（当前位置：选车->本田->雅阁）
     * @param brand_id   //品牌id
     * @param car_series_id  //车系id
     * @param car_model_id  //车型id
     * @return
     */
    @Override
    public Car_series selectBy_brand_series_model_Id(int brand_id, int car_series_id, int car_model_id) {
        return cm.selectBy_brand_series_model_Id(brand_id,car_series_id,car_model_id);
    }

}
